    package snailAI.Controller;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.http.ResponseEntity;
    import org.springframework.web.bind.annotation.*;
    import org.springframework.web.multipart.MultipartFile;
    import snailAI.Service.HandleFileService;
    import java.util.List;
    @RestController
    @RequestMapping("/api/upload")
    @CrossOrigin
    public class FileController {
        @Autowired
        HandleFileService handleFileService;

        @PostMapping("/files")
        public ResponseEntity uploadFiles(@RequestParam(name = "files") List<MultipartFile> files){
            for(MultipartFile x:files){
                handleFileService.uploadFiles(x);
            }

            return ResponseEntity.ok().body("success");
        }
    }
